import React, { Component } from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';

import Film from '../views/Film';
import Cinema from '../views/Cinema';
import Center from '../views/Center';
import NotFound from '../views/NotFound';

export default class index extends Component {
  render() {
    return (
      <>
        <Routes>
          <Route
            path="/film"
            Component={Film}
          />
          <Route
            path="/cinema"
            Component={Cinema}
          />
          <Route
            path="/center"
            Component={Center}
          />

          {/* 重定向 Navigate */}
          <Route
            index
            element={<Navigate to="/film" />}
          />
          {/* 404 */}
          <Route
            path="*"
            Component={NotFound}
          />
        </Routes>
      </>
    );
  }
}
